Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only calculate supported post types for author taxonomy once per request #1058

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

douglas-johnson
Copy link
Contributor

Description

This is intended to prevent recaculating the supported post types for the author taxonomy. The problems with the recalculation are laid out thoroughly in #1049

This was also solved in #1036 however I'm not able to re-open someone else's pull request. Thanks @justinmaurerdotdev for figuring this out the first time.

Steps to Test

If you add logging before and after the lines changd in this PR you should see 100s of calls to supported_post_types() when loading the editor, but it should only proceed with calculation once per request.

For example:

error_log('getting supported post types');
if ( ! empty( $this->supported_post_types ) ) {
    return $this->supported_post_types;
}
error_log('"$_SERVER['REQUEST_URI']");
error_log('calculating supported post types');

@justinmaurerdotdev
Copy link

Oh, hey. Nice!

@douglas-johnson douglas-johnson changed the title Only calculated supported post types for author taxonomy once per request Only calculate supported post types for author taxonomy once per request Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants